package com.example.javaproject;

public class StateTest {
}

class User {
    private String name;
    private int age;

    // 用户当前的状态，存储用户是否登录，是否选择年级, 是否绑定qq，是否绑定微信
    private int state;

    public User(String name, int age) {
        this.name = name;
        this.age = age;
    }

    /**
     * 给用户添加状态
     *
     * @param state
     */
    public void addState(int state) {
        this.state = this.state | state;
    }

    /**
     * 解除用户的某种状态
     *
     * @param state
     */
    public void releaseState(int state) {
        this.state = this.state ^ state;
    }


}

class UserState {
    public static final int init = 0;
    public static final int isLogin = 1;
    public static final int isBindGrade = 2;
    public static final int isBindQq = 4;
    public static final int isBindVx = 4;

}